var idlist = location.search
function getData() {
    var listdeatils = `http://81.71.65.4:3008/film/detail${idlist}`
    axios.get(listdeatils).then(function (result) {
        var list = result.data.data
        console.log(list)
        var premiereAts = list.premiereAt
        var now = new Date(premiereAts)
        var time = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate()
        var itemlist = list.actors
        var htmlItem = ''
        for (var aa in itemlist) {
            htmlItem +=
                `<li>
                    <div>
                        <img src="${itemlist[aa].avatarAddress}"alt="">
                        <p>${itemlist[aa].name}</p>
                        <p>${itemlist[aa].role}</p>
                    </div>
                </li>`
        }
        document.querySelector('.banner').innerHTML=
            `<img class="banner1" src="${list.poster}"alt=""/>
                <div class="banner2">
                  <div class="main">
                    <div class="main1">
                      <p class="main11"><span>${list.name}</span><span>${list.filmType.dx}</span></p>
                      <p class="main12"><span>${list.grade}</span><span>分</span></p>
                    </div>
                    <p class="main2">${list.filmType.content}</p>
                    <p class="main3">${time}上映</p>
                    <p class="main4">${list.nation} | ${list.runtime}分钟</p>
                    <p class="main5">
                      ${list.desc}
                    </p>
                  </div>
                  <div class="item">
                      <p class="item1">演职人员</p>
                      <ul>
                      ${htmlItem}
                      </ul>
                  </div>
                </div>`

    })
    
}
getData();
